package com.XZDP.mapper;

import com.XZDP.entity.Follow;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import org.apache.ibatis.annotations.Delete;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;

import java.util.List;

@Mapper
public interface FollowMapper extends BaseMapper<Follow> {
    @Delete("delete from tb_follow where user_id=#{userid} and follow_user_id=#{id}")
    void removeID(Long userid, Long id);

    @Select("select count(*) from tb_follow where user_id=#{id} and follow_user_id=#{id1}")
    Long isFollow(Long id, Long id1);

    @Select("select user_id from tb_follow where follow_user_id=#{id}")
    List<Long> getbyuserid(Long id);
}
